import numpy as np

np.random.seed(0)

distmat = np.random.randint(1, 32, size=(4, 8))
print(distmat)

print(50*'=')

# 将矩阵distmat按照axis方向排序，并返回排序后的下标
indices = np.argsort(distmat, axis=1)
print(indices)
